home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / upstart-compat-sysv.postinst < prev    next >
Text File  |  2008-09-29  |  1KB  |  58 lines

  1. #!/bin/sh -e
  2. # This script can be called in the following ways:
  3. #
  4. # After the package was installed:
  5. #    <postinst> configure <old-version>
  6. #
  7. #
  8. # If prerm fails during upgrade or fails on failed upgrade:
  9. #    <old-postinst> abort-upgrade <new-version>
  10. #
  11. # If prerm fails during deconfiguration of a package:
  12. #    <postinst> abort-deconfigure in-favour <new-package> <version>
  13. #               removing <old-package> <version>
  14. #
  15. # If prerm fails during replacement due to conflict:
  16. #    <postinst> abort-remove in-favour <new-package> <version>
  17.  
  18.  
  19. # Remove a no-longer used conffile
  20. rm_conffile()
  21. {
  22.     CONFFILE="$1"
  23.  
  24.     if [ -e "$CONFFILE".dpkg-obsolete ]; then
  25.     echo "Removing obsolete conffile $CONFFILE"
  26.     rm -f "$CONFFILE".dpkg-obsolete
  27.     fi
  28. }
  29.  
  30.  
  31. # Remove obsolete jobs
  32. rm_obsolete_jobs()
  33. {
  34.     rm_conffile /etc/event.d/rc0-halt
  35.     rm_conffile /etc/event.d/rc0-poweroff
  36. }
  37.  
  38.  
  39. case "$1" in
  40.     configure)
  41.     # Upgrade from edgy
  42.     if dpkg --compare-versions "$2" lt "0.3.5-1"; then
  43.         rm_obsolete_jobs
  44.     fi
  45.     ;;
  46.  
  47.     abort-upgrade|abort-deconfigure|abort-remove)
  48.     ;;
  49.  
  50.     *)
  51.     echo "$0 called with unknown argument \`$1'" 1>&2
  52.     exit 1
  53.     ;;
  54. esac
  55.  
  56.  
  57. exit 0
  58.